package com.yuandian.management.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuandian.api.business_monitor.po.SearchParams;
import com.yuandian.api.management.entity.ConfMenuMapping;
import com.yuandian.management.mapper.ConfMenuMappingMapper;
import com.yuandian.management.service.ConfMenuMappingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;

/**
 * 菜单映射关系表-Service实现
 * @author zfsn
 * @date 2023-4-18
 */
@Service
public class ConfMenuMappingServiceImpl extends ServiceImpl<ConfMenuMappingMapper, ConfMenuMapping>
		implements ConfMenuMappingService {

	@Autowired
	private ConfMenuMappingMapper mapper;

	@Override
	public Map<String, String> getMenuMap(SearchParams params) {
		List<ConfMenuMapping> menuMappingList = this.list();
		Map<String, String> map = new HashMap<>();
		for (ConfMenuMapping menuMapping : menuMappingList) {
			map.put(menuMapping.getMenuId(), menuMapping.getMenuName());
		}

		return map;
	}
}
